<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/public/css/bootstrap.min.css">
    <link href="/public/css/blog.min.css" rel="stylesheet" type="text/css">
</head>
<body ng-app="myApp">
{% include 'header.html' %}

<div class="container">
    <article>
        <section class="col-lg-9 blog_section">
            {% if blog %}
                <div class="blog">
                    <div class="title" >
                        <div class="title_name">
                            <a href="/full?id={{ blog.id }}" class="title1">{{ blog.caption }}</a>
                        </div>
                        <div class="time_classify">
                            <span class="publish_time">{{ blog.publish_time|date:"Y-m-d H:i" }} </span>/<a href="/searchByClassify?classify={{ blog.classification }}" class="classification">{{ blog.classification }}</a>
                        </div>
                        <div class="tag hr">
                            标签：
                            {% for tag in blog.tags.all %}
                                <a href="/searchByTag?tag={{ tag.tag_name }}">{{ tag.tag_name }}</a>
                            {% endfor %}
                        </div>
                    </div>
                    <div class="blog_content">
                        {% autoescape off %}
                            {{ blog.content }}
                        {% endautoescape %}
                    </div>
                </div>
                <div>
                    {% if blog.get_previous_by_publish_time %}
                        <a href="/full?id={{blog.get_previous_by_publish_time.id  }}">上一篇({{ blog.get_previous_by_publish_time.caption }})</a>
                    {% endif %}
                </div>
                <div>
                    {% if blog.get_next_by_publish_time %}
                        <a href="/full?id={{blog.get_next_by_publish_time.id  }}">下一篇
                            ({{ blog.get_next_by_publish_time.caption }})
                        </a>
                    {% endif %}
                </div>
            {% else %}
                <div>该文章不存在</div>
            {% endif %}
        </section>
        <aside class="col-lg-3 col-xs-12">
            <form class="" role="form" method="get" action="/searchByTag">
                <div class="input-group col-lg-12">
                    <span class="input-group-addon">按标签查找</span>
                    <input type="text" class="form-control" name="tag"/>
                    <span class="input-group-btn">
                                <input type="submit" class="btn btn-primary" value="查找"/>
                            </span>
                </div><!-- /input-group -->
            </form>
            <div class="tags">
                <ul>
                    {% for tag in tags %}
                        <li><a href="/searchByTag?tag={{ tag.tag_name }}">{{ tag.tag_name }}</a></li>
                    {% endfor %}
                </ul>
            </div>
            <form class="" role="form" method="get" action="/searchByClassify">
                <div class="input-group col-lg-12">
                    <span class="input-group-addon">按分类查找</span>
                    <input type="text" class="form-control" name="classify"/>
                    <span class="input-group-btn">
                                <input type="submit" class="btn btn-primary" value="查找"/>
                            </span>
                </div><!-- /input-group -->
            </form>
            <div class="classify">
                <ul>
                    {% for classification in classifications %}
                        <li><a href="/searchByClassify?classify={{ classification.name }}">{{ classification.name }}</a></li>
                    {% endfor %}
                </ul>
            </div>
        </aside>
    </article>
</div>
<script src="/public/js/index.min.js"></script>

</body>
</html>